﻿#include "FITKAcousticsMaterialsViscoElastic.h"


namespace Acoustics
{
    FITKAcousticsAbsMaterial::AcousticsMaterialType FITKAcousticsMaterialsViscoElastic::getAcousticsMaterialType()
    {
        return FITKAcousticsAbsMaterial::AcousticsMaterialType::ViscoElastic;
    }   

    double FITKAcousticsMaterialsViscoElastic::getPoissonsRatio() const
    {
        return _poissonsRatio;
    }

    void FITKAcousticsMaterialsViscoElastic::setPoissonsRatio(double poissonsRatio)
    {
        _poissonsRatio = poissonsRatio;
    }

    int FITKAcousticsMaterialsViscoElastic::getShearModulusSpectrumID() const
    {
        return _shearModulusSpectrumID;
    }

    void FITKAcousticsMaterialsViscoElastic::setShearModulusSpectrumID(int shearModulusSpectrumID)
    {
        _shearModulusSpectrumID = shearModulusSpectrumID;
    }

    int FITKAcousticsMaterialsViscoElastic::getDampingSpectrumID() const
    {
        return _dampingSpectrumID;
    }

    void FITKAcousticsMaterialsViscoElastic::setDampingSpectrumID(int dampingSpectrumID)
    {
        _dampingSpectrumID = dampingSpectrumID;
    }

    bool FITKAcousticsMaterialsViscoElastic::copy(Core::FITKAbstractDataObject *obj)
    {
        //转换强制类型
        Acoustics::FITKAcousticsMaterialsViscoElastic* data = dynamic_cast<Acoustics::FITKAcousticsMaterialsViscoElastic*>(obj);

        if(nullptr == data)//判断是否转换成功
        {
            return false;
        }
        //复制成员变量
        _shearModulusSpectrumID = data->getShearModulusSpectrumID();
        _dampingSpectrumID = data->getDampingSpectrumID();
        _poissonsRatio = data->getPoissonsRatio();
        // 调用父类的方法
        Acoustics::FITKAcousticsAbsMaterial::copy(obj);
        return true;
    }

}
